import routerNames from '@/router/routerNames'
import type { RouteRecordRaw } from 'vue-router'
//import {defineAsyncComponent} from 'vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: routerNames.main,
    redirect: {name: routerNames.home},
    component: () => import('@/views/Main.vue'),
    children:[]
  },
  {
    path: '/login',
    name: routerNames.login,
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/:pathMatch(.*)*', // 🔴 必须放在最后
    name: '404',
    component: () => import('@/views/404.vue')
  }
]

export default routes
